import { createRouter, createWebHashHistory } from "vue-router";

import home from '@/components/home-page/home.vue';
import front from '@/components/course-details/yemian.vue';
import LoginView from '@/components/login-register/Log_reg.vue';
// import RegisterView from '@/components/login-register/RegisterView.vue';
import aboutview from '@/components/aboutours/AboutView.vue';
import task from '@/components/course-details/views/HomeView.vue';
import answer from '@/components/course-details/views/AboutView.vue';
import progress from '@/components/course-details/views/jindu.vue';
import vote from '@/components/course-details/views/zhuye.vue';
import learnplaza from '@/components/learning-plaza/suoy.vue';
import mycourse from '@/components/mycourse/course.vue';
// import srp from '@/components/learning-plaza/srp.vue'
// import Competitions from '@/components/learning-plaza/competition.vue'
// import Training from '@/components/learning-plaza/training.vue'
// import SelfLearning from '@/components/learning-plaza/self-learning.vue'
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/', // 根路径  
            redirect: '/home' // 重定向到 /home  
        },
        {
            path: '/home',
            component: home
        },
        {
            path: '/front',
            component: front,
            children: [
                {
                    path: '', // 空字符串表示 /front 下的默认子路径  
                    redirect: 'task' // 重定向到 /front/task  
                },
                {
                    path: 'task',
                    component: task
                },
                {
                    path: 'answer',
                    component: answer
                },
                {
                    path: 'progress',
                    component: progress
                },
                {
                    path: 'vote',
                    component: vote
                }
            ]
        },
        {
            path: '/login',
            component: LoginView
        },
        // {
        //     path: '/register',
        //     component: RegisterView
        // },
        {
            path: '/aboutview',
            component: aboutview
        },
        {
            path: '/learnplaza',
            component: learnplaza
        },
        {
            path: '/mycourse',
            component: mycourse
        }
        ,
        // {
        //     path: '/srp',
        //     component: srp
        // },
        // {
        //     path: '/competitions',
        //     component: Competitions
        // },
        // {
        //     path: '/training',
        //     component: Training
        // },
        // {
        //     path: '/self-learning',
        //     component: SelfLearning
        // }
    ]
})

export default router